package com.chance.cc.crawler.prod.command.trigger.domain.commerce.sn;

import com.chance.cc.crawler.core.CrawlerJob;
import com.chance.cc.crawler.meta.core.bean.CrawlerMetaConstant;
import com.chance.cc.crawler.prod.command.job.domain.commerce.sn.realtime.SNArticleCrawlerScheduleJob;
import com.chance.cc.crawler.prod.command.job.domain.commerce.sn.realtime.SNArticleUrlCrawlerScheduleJob;
import com.chance.cc.crawler.prod.command.job.domain.commerce.sn.realtime.SNCommentCrawlerScheduleJob;
import com.chance.cc.crawler.prod.command.trigger.CommonCrawlerSchedulerTrigger;

/**
 * @ClassName sn
 * @Description TODO
 * @Author songding
 * @Date 2021/10/20 15:29
 * @Version 1.0
 **/
public class SNCommonCrawlerScheduleTrigger  extends CommonCrawlerSchedulerTrigger {
    public static void main(String[] args) {
        //苏宁评论
       // publishSNCommentScheduleTriggerInfo();
        //苏宁文章
         //publishSNArticleScheduleTriggerInfo();
        //苏宁文章每月采集一次全品链接
         publishSNArticleUrlScheduleTriggerInfo();
    }
    public static void publishSNCommentScheduleTriggerInfo(){
        CrawlerJob crawlerJob = SNCommentCrawlerScheduleJob.snCrawlerJob();
        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                SNCommentCrawlerScheduleJob.domain,
                 CrawlerMetaConstant.ScheduleJobTrigger_Cron,
               // CrawlerMetaConstant.ScheduleJobTrigger_Simple,
                "0 10 6 * * ?",
                //"",
                "苏宁评论每天凌晨6：10点采集一次");
    }

    public static void publishSNArticleScheduleTriggerInfo(){
        CrawlerJob crawlerJob = SNArticleCrawlerScheduleJob.snCrawlerJob();
        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                SNArticleCrawlerScheduleJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                //CrawlerMetaConstant.ScheduleJobTrigger_Simple,
                "0 10 16 * * ?",
                //"",
                "苏宁文章每天16：10点采集一次");
    }
    public static void publishSNArticleUrlScheduleTriggerInfo(){
        CrawlerJob crawlerJob = SNArticleUrlCrawlerScheduleJob.snCrawlerJob();
        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                SNArticleUrlCrawlerScheduleJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                //CrawlerMetaConstant.ScheduleJobTrigger_Simple,
                "0 0 16 27 * ?",
                //"",
                "苏宁文章每月采集一次全品链接");
    }

}
